package club.beimeng.properties;

import org.junit.Test;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class TestProperties {
    @Test
    public void main() throws IOException {

        Properties properties = new Properties();

//        InputStream inp = this.getClass().getResourceAsStream("accounts.properties");
        InputStream inp = this.getClass().getResourceAsStream("/accounts.properties");
        InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream("accounts.properties");

        properties.load(resourceAsStream);

        properties.load(inp);

        properties.forEach( (key,val)->{
            System.out.println("key = " + key);
            System.out.println("val = " + val);
        });
    }
}
